
import * as ActionTypes from '../../../constants/constants.js'
import * as util from '../../../util/utils.js'

export const magazineDetails = (state = {}, action) => {
    switch (action.type) {
        case ActionTypes.magazineDetails:
            return action.data
        case ActionTypes.magazineDetailsError:
            state.error = action.data.error
            return {
                ...state,
                ...action.data
            }
        default:
            return state;
    }
}

export const magazineAttr = (state = {}, action) => {
    switch (action.type) {
        case ActionTypes.magazineAttr:
            return action.data
        case ActionTypes.magazineAttrError:
            state.error = action.data.error
            return {
                ...state,
                ...action.data
            }
        default:
            return state;
    }
}
